<?php
 session_start();
 date_default_timezone_set("Asia/Shanghai");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>订单总览</title>
<link href="style/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> 
<script src="js/jquery.blockUI.js" type="text/javascript"></script>
<script src="js/My97DatePicker/WdatePicker.js"
      type="text/javascript"></script> 
<script type="text/javascript" src="js/lrtk.js"></script>
<script type="text/javascript"> 

function memberref(){
var begindate=$("#qishinian").val()+$("#qishiyue").val()+$("#qishiri").val()+"000000";
var enddate=$("#jiezhinian").val()+$("#jiezhiyue").val()+$("#jiezhiri").val()+"000000";
window.location.href="member-dd.php?begindate="+begindate+"&enddate="+enddate;

}

$(function(){ 
//Default Action 
$(".tab_content").hide(); //Hide all content 
$("ul.tabs li:first").addClass("active").show(); //Activate first tab 
$(".tab_content:first").show(); //Show first tab content 
//On Click Event 
$("ul.tabs li").click(function() { 
$("ul.tabs li").removeClass("active"); //Remove any "active" class 
$(this).addClass("active"); //Add "active" class to selected tab 
$(".tab_content").hide(); //Hide all tab content 
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content 
$(activeTab).fadeIn(); //Fade in the active content 
return false; 
}); 
}); 
</script> 
<script type="text/javascript"> 
$(function(){
$('#login').click(function(){   //给box_btn绑定一个鼠标点击的事件
$.blockUI({    //当点击事件发生时调用弹出层
  message: $('#loginbox'),    //要弹出的元素box
  css: {    //弹出元素的CSS属性
    border:'5px solid #334343',
    textAlign: 'left',
	width: '490px',
	top:  ($(window).height() - 290) /2 + 'px', 
    left: ($(window).width() - 490) /2 + 'px', 
	cursor: 'auto'
       },
  overlayCSS: {
	opacity: '0.7' 
	          }
         });
$('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
$('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层

});

});
</script> 
</head>

<body>

<div id="loginbox" style="display:none">
  <div class="login_title">会员登录</div>
  <div class="login_input">
    <div class="input"><span>账号：</span><span><input name="user" type="text" /></span></div>
    <div class="input"><span>密码：</span><span><input name="pwd" type="password" /></span></div>
    <div class="login_input_1 clearfix"><input name="" type="checkbox" value="" id="store1" /><label for="store1">自动登录</label><a href="#">找回密码</a></div>
    <div class="reg clearfix"><span><input class="login_btn" name="" type="image" src="images/login.jpg" /></span><span>还没有账号？</span><a href="#">立即注册</a></div>
  </div>
</div>

<div class="top">
  <div class="top_content clearfix"><span class="left"><a href="index.php"><img src="images/wmwlogo.png"></a></span><span class="right">
 
  <?php
    if(isset($_SESSION['username'])){
      if($_SESSION['logintype']=="userlog"){
     echo '<a href="member.php">'.$_SESSION['username'],'欢迎你！</a>';
}elseif ($_SESSION['logintype']=="supplierlog") {
   echo '<a href="shop-xx.php">'.$_SESSION['username'],'欢迎你！</a>';
}
      echo '<a href="login.php?action=logout">登出</a>';
    }else{
      echo ' <a href="#" id="login">';
      echo '登录';
      echo '</a> / <a href="reg11.php">注册</a>';
    }
  ?>
  <?php  
      if(!isset($_SESSION['username'])  ){
   ?>
  | <a href="#"  id="shoplogin">店铺登录</a></span></div>
  <?php 
    }

   ?>
</div>

<div class="content clearfix">
  <div class="content_con clearfix">
    <div class="box_left left">
      <div class="box">
        <div class="box_title"><div class="box_title_con left">
 <?php
              echo $_SESSION['username'];
            ?></div>
            <?php
            if($_SESSION['userlevel']==0){

            ?>
            <div class="lv1 left">
              <?php

                }else{
              ?>
        <div class="lv<?php echo $_SESSION['userlevel'] ?> left">
<?php 
  }
?>

        </div></div>
        <ul class="clearfix box_ul">
          <li><span class="ico2"><a href="member.php">我的订单</a></span></li>
          <li class="liselect"><span class="ico8select"><a href="member-dd.php">订单明细</a></span></li>
          <li><span class="ico3"><a href="member-add.php">我的地址</a></span></li>
          <li><span class="ico4"><a href="member-edpass.php">修改密码</a></span></li>
        </ul>
      </div>
    </div>
    <div class="box_right right">
      <div class="box" >
        <div class="box_title">
          <div class="box_title_title">订单明细</div>
        </div>
        <div class="box_content">
          <div class="box_addr1">
          <div class="dd_rq2"><input type="image" onclick="memberref()" src="images/logininput.jpg"></div>
          <div class="dd_rq1">截止日期 <input id="jiezhinian" type="text" name="open_time2" id="riqiNian"  value="<?php echo date("Y") ?>"  style="width:59px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy'})">
          	年 
          	<input type="text" id="jiezhiyue" name="open_time2" id="riqiNian"  value="<?php echo  date("m",strtotime('+1 month', time())) ?>"  style="width:33px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'MM'})">
          	月 <input type="text" id="jiezhiri" name="open_time2" id="riqiNian"  value="<?php echo date("d") ?>"  style="width:33px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'dd'})">
          	日</div>
          	<div class="dd_rq">起始日期 
          	<input id="qishinian" type="text" name="open_time2" id="riqiNian"  value="<?php echo date("Y") ?>"  style="width:59px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy'})">
          	年  
          	<input id="qishiyue" type="text" name="open_time2" id="riqiNian"  value="<?php echo date("m") ?>"  style="width:33px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'MM'})">
          	月  
          	<input  id="qishiri" type="text" name="open_time2" id="riqiNian"  value="<?php echo date("d") ?>"  style="width:33px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'dd'})">
          	日</div>                  
          </div>
          <div class="box_addr_con1">
            <div class="box_addr_con_tit clearfix"><span class="con_1">单号</span><span class="con_2">日期</span><span class="con_3">金额</span></div>
            <ul class="box_addr_con_list">
<?php
 include('system/db/conn.php');

            
            $numzong=0;
             $pricezong=0;
             $myownsql="select * from do_deal_order where user_id=".$_SESSION['userid']." order by create_time desc";
             if(isset($_GET['begindate'])&&isset($_GET['enddate'])){
             	$chuo=strtotime($_GET['begindate']);

             	$chuo2=strtotime($_GET['enddate']);
             	$myownsql="select * from do_deal_order where user_id=".$_SESSION['userid']." and (create_time between '".$chuo."' and '".$chuo2."' )order by create_time desc";

             }

	$area_query = mysql_query($myownsql);
          while($row = mysql_fetch_array($area_query)){
          	$numzong+=1;
          	$pricezong+=$row['total_price'];

?>



              <li><span class="con_1"><?php echo $row['order_sn'] ?> </span><span class="con_2"><?php echo date("Y-m-j H:i:s",$row['create_time']) ?></span><span class="con_3">￥<?php echo round($row['total_price'],1)  ?></span></li>
              
<?php

}?>

              
            </ul>
            <div class="dd_zje">总计：<span><?php echo $numzong ?></span> 个订单   &nbsp; 总金额：<span>￥<?php echo $pricezong ?></span> </div>
          </div>
         </div>
      </div>
    </div>
  </div>
</div>

<div class="bottom">
  <div class="bottom_content clearfix">
    <div class="bottom_left left"><img src="images/logo_s.gif"></div>
    <div class="bottom_right left">
      <div><a href="#">关于我们</a>&nbsp;&nbsp; | &nbsp;&nbsp;<a href="#">诚招英才</a>&nbsp;&nbsp; | &nbsp;&nbsp;<a href="#">合作商谈</a>&nbsp;&nbsp; | &nbsp;&nbsp;<a href="#">网站地图</a>&nbsp;&nbsp; | &nbsp;&nbsp;<a href="#">免责条款</a></div>
      <div>Copyright © 2013 waimaiwang365.com All rights reserved  京ICP备030173号</div>
    </div>
  </div>
</div>
</body>
</html>
